import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    // state 管理的数组、对象、字符串等等，  调用：this.$store.state.goodsList
    state: {
        //商品数据
        goodsList: [
            {
                title: "烧烤食材",
                parentIndex: 0,
                list: [
                    {
                        id: 1,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 200,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '冷冻',
                        num: 0,
                        imgUrl: "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg",
                    },
                    {
                        id: 2,
                        index: 1,
                        title: "小白菜450g",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 3,
                        index: 2,
                        title: "柠檬",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 4,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 400,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "卤味食材",
                parentIndex: 1,
                list: [
                    {
                        id: 5,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 500,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 6,
                        index: 1,
                        title: "小白菜450g",
                        price: 600,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '冷冻',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 7,
                        index: 2,
                        title: "柠檬",
                        price: 700,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 8,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 800,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "时令蔬菜",
                parentIndex: 2,
                list: [
                    {
                        id: 9,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 900,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 10,
                        index: 1,
                        title: "小白菜450g",
                        price: 1000,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 11,
                        index: 2,
                        title: "柠檬",
                        price: 11,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 12,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 12,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "美味小料",
                parentIndex: 3,
                list: [
                    {
                        id: 13,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 13,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 14,
                        index: 1,
                        title: "小白菜450g",
                        price: 104,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 15,
                        index: 2,
                        title: "柠檬",
                        price: 150,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 16,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 160,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "男装",
                parentIndex: 4,
                list: [
                    {
                        id: 17,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 170,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 18,
                        index: 1,
                        title: "小白菜450g",
                        price: 180,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 19,
                        index: 2,
                        title: "柠檬",
                        price: 190,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 20,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 200,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "珠宝",
                parentIndex: 5,
                list: [
                    {
                        id: 21,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 210,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 22,
                        index: 1,
                        title: "小白菜450g",
                        price: 210,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 23,
                        index: 2,
                        title: "柠檬",
                        price: 120,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 24,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 415,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "首饰",
                parentIndex: 6,
                list: [
                    {
                        id: 26,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 469,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 27,
                        index: 1,
                        title: "小白菜450g",
                        price: 270,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 28,
                        index: 2,
                        title: "柠檬",
                        price: 280,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 29,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 290,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "鞋子",
                parentIndex: 7,
                list: [
                    {
                        id: 30,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            }
        ],
        copyGoodsList: [
            {
                title: "烧烤食材",
                parentIndex: 0,
                list: [
                    {
                        id: 1,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 200,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl: "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg",
                    },
                    {
                        id: 2,
                        index: 1,
                        title: "小白菜450g",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 3,
                        index: 2,
                        title: "柠檬",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 4,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 400,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "卤味食材",
                parentIndex: 1,
                list: [
                    {
                        id: 5,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 500,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 6,
                        index: 1,
                        title: "小白菜450g",
                        price: 600,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 7,
                        index: 2,
                        title: "柠檬",
                        price: 700,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 8,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 800,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "时令蔬菜",
                parentIndex: 2,
                list: [
                    {
                        id: 9,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 900,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 10,
                        index: 1,
                        title: "小白菜450g",
                        price: 1000,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 11,
                        index: 2,
                        title: "柠檬",
                        price: 11,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 12,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 12,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "美味小料",
                parentIndex: 3,
                list: [
                    {
                        id: 13,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 13,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 14,
                        index: 1,
                        title: "小白菜450g",
                        price: 104,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 15,
                        index: 2,
                        title: "柠檬",
                        price: 150,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 16,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 160,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "男装",
                parentIndex: 4,
                list: [
                    {
                        id: 17,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 170,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 18,
                        index: 1,
                        title: "小白菜450g",
                        price: 180,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 19,
                        index: 2,
                        title: "柠檬",
                        price: 190,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 20,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 200,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "珠宝",
                parentIndex: 5,
                list: [
                    {
                        id: 21,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 210,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 22,
                        index: 1,
                        title: "小白菜450g",
                        price: 210,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 23,
                        index: 2,
                        title: "柠檬",
                        price: 120,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 24,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 415,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "首饰",
                parentIndex: 6,
                list: [
                    {
                        id: 26,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 469,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 27,
                        index: 1,
                        title: "小白菜450g",
                        price: 270,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 28,
                        index: 2,
                        title: "柠檬",
                        price: 280,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },
                    {
                        id: 29,
                        index: 3,
                        title: "胡萝卜800g",
                        price: 290,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            },
            {
                title: "鞋子",
                parentIndex: 7,
                list: [
                    {
                        id: 30,
                        index: 0,
                        title: "秘制小番茄500g",
                        price: 300,
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ]
            }
        ],//复制原有商品数据
        shopCartObj: {//购物车数据
            headquarters: { //总部直供
                shopCartArray: [],//购物车
                warehouseType: '',// 常温 或 冷冻
                allShopCartCount: 0,//购物车商品总数
                allShopCartPrice: 0,//购物车总价格
                isSameWare: true,//是相同的仓库吗
            },
            selfMining: {  //门店自采
                shopCartArray: [],//购物车
                warehouseType: '',// 常温 或 冷冻
                allShopCartCount: 0,//购物车商品总数
                allShopCartPrice: 0,//购物车总价格
                isSameWare: true,//是相同的仓库吗
            }
        },
        purchaseType: 0,//0:总部直供  1：门店自采
        //地址列表
        addressData: [
            {
                "code": "11",
                "name": "北京市",
                "children": [
                    {
                        "code": "1101",
                        "name": "市辖区",
                        "children": [
                            {
                                "code": "110101",
                                "name": "东城区"
                            },
                            {
                                "code": "110102",
                                "name": "西城区"
                            },
                            {
                                "code": "110105",
                                "name": "朝阳区"
                            },
                            {
                                "code": "110106",
                                "name": "丰台区"
                            },
                            {
                                "code": "110107",
                                "name": "石景山区"
                            },
                            {
                                "code": "110108",
                                "name": "海淀区"
                            },
                            {
                                "code": "110109",
                                "name": "门头沟区"
                            },
                            {
                                "code": "110111",
                                "name": "房山区"
                            },
                            {
                                "code": "110112",
                                "name": "通州区"
                            },
                            {
                                "code": "110113",
                                "name": "顺义区"
                            },
                            {
                                "code": "110114",
                                "name": "昌平区"
                            },
                            {
                                "code": "110115",
                                "name": "大兴区"
                            },
                            {
                                "code": "110116",
                                "name": "怀柔区"
                            },
                            {
                                "code": "110117",
                                "name": "平谷区"
                            },
                            {
                                "code": "110118",
                                "name": "密云区"
                            },
                            {
                                "code": "110119",
                                "name": "延庆区"
                            }
                        ]
                    }
                ]
            },
            {
                "code": "13",
                "name": "河北省",
                "children": [
                    {
                        "code": "1301",
                        "name": "石家庄市",
                        "children": [
                            {
                                "code": "130102",
                                "name": "长安区"
                            },
                            {
                                "code": "130104",
                                "name": "桥西区"
                            },
                            {
                                "code": "130105",
                                "name": "新华区"
                            },
                            {
                                "code": "130107",
                                "name": "井陉矿区"
                            },
                            {
                                "code": "130108",
                                "name": "裕华区"
                            },
                            {
                                "code": "130109",
                                "name": "藁城区"
                            },
                            {
                                "code": "130110",
                                "name": "鹿泉区"
                            },
                            {
                                "code": "130111",
                                "name": "栾城区"
                            },
                            {
                                "code": "130121",
                                "name": "井陉县"
                            },
                            {
                                "code": "130123",
                                "name": "正定县"
                            },
                            {
                                "code": "130125",
                                "name": "行唐县"
                            },
                            {
                                "code": "130126",
                                "name": "灵寿县"
                            },
                            {
                                "code": "130127",
                                "name": "高邑县"
                            },
                            {
                                "code": "130128",
                                "name": "深泽县"
                            },
                            {
                                "code": "130129",
                                "name": "赞皇县"
                            },
                            {
                                "code": "130130",
                                "name": "无极县"
                            },
                            {
                                "code": "130131",
                                "name": "平山县"
                            },
                            {
                                "code": "130132",
                                "name": "元氏县"
                            },
                            {
                                "code": "130133",
                                "name": "赵县"
                            },
                            {
                                "code": "130183",
                                "name": "晋州市"
                            },
                            {
                                "code": "130184",
                                "name": "新乐市"
                            }
                        ]
                    },
                    {
                        "code": "1302",
                        "name": "唐山市",
                        "children": [
                            {
                                "code": "130202",
                                "name": "路南区"
                            },
                            {
                                "code": "130203",
                                "name": "路北区"
                            },
                            {
                                "code": "130204",
                                "name": "古冶区"
                            },
                            {
                                "code": "130205",
                                "name": "开平区"
                            },
                            {
                                "code": "130207",
                                "name": "丰南区"
                            },
                            {
                                "code": "130208",
                                "name": "丰润区"
                            },
                            {
                                "code": "130209",
                                "name": "曹妃甸区"
                            },
                            {
                                "code": "130223",
                                "name": "滦县"
                            },
                            {
                                "code": "130224",
                                "name": "滦南县"
                            },
                            {
                                "code": "130225",
                                "name": "乐亭县"
                            },
                            {
                                "code": "130227",
                                "name": "迁西县"
                            },
                            {
                                "code": "130229",
                                "name": "玉田县"
                            },
                            {
                                "code": "130281",
                                "name": "遵化市"
                            },
                            {
                                "code": "130283",
                                "name": "迁安市"
                            }
                        ]
                    },
                    {
                        "code": "1303",
                        "name": "秦皇岛市",
                        "children": [
                            {
                                "code": "130302",
                                "name": "海港区"
                            },
                            {
                                "code": "130303",
                                "name": "山海关区"
                            },
                            {
                                "code": "130304",
                                "name": "北戴河区"
                            },
                            {
                                "code": "130306",
                                "name": "抚宁区"
                            },
                            {
                                "code": "130321",
                                "name": "青龙满族自治县"
                            },
                            {
                                "code": "130322",
                                "name": "昌黎县"
                            },
                            {
                                "code": "130324",
                                "name": "卢龙县"
                            }
                        ]
                    },
                    {
                        "code": "1304",
                        "name": "邯郸市",
                        "children": [
                            {
                                "code": "130402",
                                "name": "邯山区"
                            },
                            {
                                "code": "130403",
                                "name": "丛台区"
                            },
                            {
                                "code": "130404",
                                "name": "复兴区"
                            },
                            {
                                "code": "130406",
                                "name": "峰峰矿区"
                            },
                            {
                                "code": "130421",
                                "name": "邯郸县"
                            },
                            {
                                "code": "130423",
                                "name": "临漳县"
                            },
                            {
                                "code": "130424",
                                "name": "成安县"
                            },
                            {
                                "code": "130425",
                                "name": "大名县"
                            },
                            {
                                "code": "130426",
                                "name": "涉县"
                            },
                            {
                                "code": "130427",
                                "name": "磁县"
                            },
                            {
                                "code": "130428",
                                "name": "肥乡县"
                            },
                            {
                                "code": "130429",
                                "name": "永年县"
                            },
                            {
                                "code": "130430",
                                "name": "邱县"
                            },
                            {
                                "code": "130431",
                                "name": "鸡泽县"
                            },
                            {
                                "code": "130432",
                                "name": "广平县"
                            },
                            {
                                "code": "130433",
                                "name": "馆陶县"
                            },
                            {
                                "code": "130434",
                                "name": "魏县"
                            },
                            {
                                "code": "130435",
                                "name": "曲周县"
                            },
                            {
                                "code": "130481",
                                "name": "武安市"
                            }
                        ]
                    },
                    {
                        "code": "1305",
                        "name": "邢台市",
                        "children": [
                            {
                                "code": "130502",
                                "name": "桥东区"
                            },
                            {
                                "code": "130503",
                                "name": "桥西区"
                            },
                            {
                                "code": "130521",
                                "name": "邢台县"
                            },
                            {
                                "code": "130522",
                                "name": "临城县"
                            },
                            {
                                "code": "130523",
                                "name": "内丘县"
                            },
                            {
                                "code": "130524",
                                "name": "柏乡县"
                            },
                            {
                                "code": "130525",
                                "name": "隆尧县"
                            },
                            {
                                "code": "130526",
                                "name": "任县"
                            },
                            {
                                "code": "130527",
                                "name": "南和县"
                            },
                            {
                                "code": "130528",
                                "name": "宁晋县"
                            },
                            {
                                "code": "130529",
                                "name": "巨鹿县"
                            },
                            {
                                "code": "130530",
                                "name": "新河县"
                            },
                            {
                                "code": "130531",
                                "name": "广宗县"
                            },
                            {
                                "code": "130532",
                                "name": "平乡县"
                            },
                            {
                                "code": "130533",
                                "name": "威县"
                            },
                            {
                                "code": "130534",
                                "name": "清河县"
                            },
                            {
                                "code": "130535",
                                "name": "临西县"
                            },
                            {
                                "code": "130581",
                                "name": "南宫市"
                            },
                            {
                                "code": "130582",
                                "name": "沙河市"
                            }
                        ]
                    },
                    {
                        "code": "1306",
                        "name": "保定市",
                        "children": [
                            {
                                "code": "130602",
                                "name": "竞秀区"
                            },
                            {
                                "code": "130606",
                                "name": "莲池区"
                            },
                            {
                                "code": "130607",
                                "name": "满城区"
                            },
                            {
                                "code": "130608",
                                "name": "清苑区"
                            },
                            {
                                "code": "130609",
                                "name": "徐水区"
                            },
                            {
                                "code": "130623",
                                "name": "涞水县"
                            },
                            {
                                "code": "130624",
                                "name": "阜平县"
                            },
                            {
                                "code": "130626",
                                "name": "定兴县"
                            },
                            {
                                "code": "130627",
                                "name": "唐县"
                            },
                            {
                                "code": "130628",
                                "name": "高阳县"
                            },
                            {
                                "code": "130629",
                                "name": "容城县"
                            },
                            {
                                "code": "130630",
                                "name": "涞源县"
                            },
                            {
                                "code": "130631",
                                "name": "望都县"
                            },
                            {
                                "code": "130632",
                                "name": "安新县"
                            },
                            {
                                "code": "130633",
                                "name": "易县"
                            },
                            {
                                "code": "130634",
                                "name": "曲阳县"
                            },
                            {
                                "code": "130635",
                                "name": "蠡县"
                            },
                            {
                                "code": "130636",
                                "name": "顺平县"
                            },
                            {
                                "code": "130637",
                                "name": "博野县"
                            },
                            {
                                "code": "130638",
                                "name": "雄县"
                            },
                            {
                                "code": "130681",
                                "name": "涿州市"
                            },
                            {
                                "code": "130683",
                                "name": "安国市"
                            },
                            {
                                "code": "130684",
                                "name": "高碑店市"
                            }
                        ]
                    },
                    {
                        "code": "1307",
                        "name": "张家口市",
                        "children": [
                            {
                                "code": "130702",
                                "name": "桥东区"
                            },
                            {
                                "code": "130703",
                                "name": "桥西区"
                            },
                            {
                                "code": "130705",
                                "name": "宣化区"
                            },
                            {
                                "code": "130706",
                                "name": "下花园区"
                            },
                            {
                                "code": "130708",
                                "name": "万全区"
                            },
                            {
                                "code": "130709",
                                "name": "崇礼区"
                            },
                            {
                                "code": "130722",
                                "name": "张北县"
                            },
                            {
                                "code": "130723",
                                "name": "康保县"
                            },
                            {
                                "code": "130724",
                                "name": "沽源县"
                            },
                            {
                                "code": "130725",
                                "name": "尚义县"
                            },
                            {
                                "code": "130726",
                                "name": "蔚县"
                            },
                            {
                                "code": "130727",
                                "name": "阳原县"
                            },
                            {
                                "code": "130728",
                                "name": "怀安县"
                            },
                            {
                                "code": "130730",
                                "name": "怀来县"
                            },
                            {
                                "code": "130731",
                                "name": "涿鹿县"
                            },
                            {
                                "code": "130732",
                                "name": "赤城县"
                            }
                        ]
                    },
                    {
                        "code": "1308",
                        "name": "承德市",
                        "children": [
                            {
                                "code": "130802",
                                "name": "双桥区"
                            },
                            {
                                "code": "130803",
                                "name": "双滦区"
                            },
                            {
                                "code": "130804",
                                "name": "鹰手营子矿区"
                            },
                            {
                                "code": "130821",
                                "name": "承德县"
                            },
                            {
                                "code": "130822",
                                "name": "兴隆县"
                            },
                            {
                                "code": "130823",
                                "name": "平泉县"
                            },
                            {
                                "code": "130824",
                                "name": "滦平县"
                            },
                            {
                                "code": "130825",
                                "name": "隆化县"
                            },
                            {
                                "code": "130826",
                                "name": "丰宁满族自治县"
                            },
                            {
                                "code": "130827",
                                "name": "宽城满族自治县"
                            },
                            {
                                "code": "130828",
                                "name": "围场满族蒙古族自治县"
                            }
                        ]
                    },
                    {
                        "code": "1309",
                        "name": "沧州市",
                        "children": [
                            {
                                "code": "130902",
                                "name": "新华区"
                            },
                            {
                                "code": "130903",
                                "name": "运河区"
                            },
                            {
                                "code": "130921",
                                "name": "沧县"
                            },
                            {
                                "code": "130922",
                                "name": "青县"
                            },
                            {
                                "code": "130923",
                                "name": "东光县"
                            },
                            {
                                "code": "130924",
                                "name": "海兴县"
                            },
                            {
                                "code": "130925",
                                "name": "盐山县"
                            },
                            {
                                "code": "130926",
                                "name": "肃宁县"
                            },
                            {
                                "code": "130927",
                                "name": "南皮县"
                            },
                            {
                                "code": "130928",
                                "name": "吴桥县"
                            },
                            {
                                "code": "130929",
                                "name": "献县"
                            },
                            {
                                "code": "130930",
                                "name": "孟村回族自治县"
                            },
                            {
                                "code": "130981",
                                "name": "泊头市"
                            },
                            {
                                "code": "130982",
                                "name": "任丘市"
                            },
                            {
                                "code": "130983",
                                "name": "黄骅市"
                            },
                            {
                                "code": "130984",
                                "name": "河间市"
                            }
                        ]
                    },
                    {
                        "code": "1310",
                        "name": "廊坊市",
                        "children": [
                            {
                                "code": "131002",
                                "name": "安次区"
                            },
                            {
                                "code": "131003",
                                "name": "广阳区"
                            },
                            {
                                "code": "131022",
                                "name": "固安县"
                            },
                            {
                                "code": "131023",
                                "name": "永清县"
                            },
                            {
                                "code": "131024",
                                "name": "香河县"
                            },
                            {
                                "code": "131025",
                                "name": "大城县"
                            },
                            {
                                "code": "131026",
                                "name": "文安县"
                            },
                            {
                                "code": "131028",
                                "name": "大厂回族自治县"
                            },
                            {
                                "code": "131081",
                                "name": "霸州市"
                            },
                            {
                                "code": "131082",
                                "name": "三河市"
                            }
                        ]
                    },
                    {
                        "code": "1311",
                        "name": "衡水市",
                        "children": [
                            {
                                "code": "131102",
                                "name": "桃城区"
                            },
                            {
                                "code": "131103",
                                "name": "冀州区"
                            },
                            {
                                "code": "131121",
                                "name": "枣强县"
                            },
                            {
                                "code": "131122",
                                "name": "武邑县"
                            },
                            {
                                "code": "131123",
                                "name": "武强县"
                            },
                            {
                                "code": "131124",
                                "name": "饶阳县"
                            },
                            {
                                "code": "131125",
                                "name": "安平县"
                            },
                            {
                                "code": "131126",
                                "name": "故城县"
                            },
                            {
                                "code": "131127",
                                "name": "景县"
                            },
                            {
                                "code": "131128",
                                "name": "阜城县"
                            },
                            {
                                "code": "131182",
                                "name": "深州市"
                            }
                        ]
                    },
                    {
                        "code": "1390",
                        "name": "省直辖县级行政区划",
                        "children": [
                            {
                                "code": "139001",
                                "name": "定州市"
                            },
                            {
                                "code": "139002",
                                "name": "辛集市"
                            }
                        ]
                    }
                ]
            },
            {
                "code": "12",
                "name": "天津市",
                "children": [
                    {
                        "code": "1201",
                        "name": "市辖区",
                        "children": [
                            {
                                "code": "120101",
                                "name": "和平区"
                            },
                            {
                                "code": "120102",
                                "name": "河东区"
                            },
                            {
                                "code": "120103",
                                "name": "河西区"
                            },
                            {
                                "code": "120104",
                                "name": "南开区"
                            },
                            {
                                "code": "120105",
                                "name": "河北区"
                            },
                            {
                                "code": "120106",
                                "name": "红桥区"
                            },
                            {
                                "code": "120110",
                                "name": "东丽区"
                            },
                            {
                                "code": "120111",
                                "name": "西青区"
                            },
                            {
                                "code": "120112",
                                "name": "津南区"
                            },
                            {
                                "code": "120113",
                                "name": "北辰区"
                            },
                            {
                                "code": "120114",
                                "name": "武清区"
                            },
                            {
                                "code": "120115",
                                "name": "宝坻区"
                            },
                            {
                                "code": "120116",
                                "name": "滨海新区"
                            },
                            {
                                "code": "120117",
                                "name": "宁河区"
                            },
                            {
                                "code": "120118",
                                "name": "静海区"
                            },
                            {
                                "code": "120119",
                                "name": "蓟州区"
                            }
                        ]
                    }
                ]
            },
        ],
    },
    // 改变state的值--回调函数,调用方法：this.$store.commit('函数名')
    mutations: {

        //购物车加 +
        AddShopCartGlobalFun(state, data) {
            var index = data.index;
            var parentIndex = data.parentIndex;
            var item = state.goodsList[parentIndex].list[index];
            //根据选的采购方式，来操作不同购物车的数据  state.purchaseType =》 0：总店直供  1：门店自采
            var $thisShopCart = state.purchaseType == 0 ? state.shopCartObj.headquarters : state.shopCartObj.selfMining;
            var shopCartArray = $thisShopCart.shopCartArray;
            if (shopCartArray.length == 0) {
                $thisShopCart.warehouseType = item.warehouse
            } else {
                // console.log($thisShopCart.warehouseType, item.warehouse)
                if ($thisShopCart.warehouseType != item.warehouse) {
                    // console.log('常温仓和冷冻仓不可以同时加购')
                    $thisShopCart.isSameWare = false
                    return
                } else {
                    $thisShopCart.isSameWare = true
                }
            }
            item.num = ++item.num;
            item.index = index;
            item.parentIndex = parentIndex;
            shopCartArray.push(item)
            state.goodsList[parentIndex].list[index].num = item.num
            var arr = [];
            //去重
            for (var i = 0; i < shopCartArray.length; i++) {
                if (item.id == shopCartArray[i].id) {
                    shopCartArray.splice(i, 1, item)
                }
                if (arr.indexOf(shopCartArray[i]) == -1) {
                    arr.push(shopCartArray[i]);
                }
            }
            $thisShopCart.shopCartArray = arr
            // console.log(state.shopCartObj)
        },
        //购物车减 -
        minusShopCartGlobalFun(state, data) {
            var index = data.index;
            var parentIndex = data.parentIndex;
            var item = state.goodsList[parentIndex].list[index];
            //根据选的采购方式，来操作不同购物车的数据  state.purchaseType =》 0：总店直供  1：门店自采
            var $thisShopCart = state.purchaseType == 0 ? state.shopCartObj.headquarters : state.shopCartObj.selfMining;
            var shopCartArray = $thisShopCart.shopCartArray;
            $thisShopCart.isSameWare = true
            if (data.num) { // input 手动修改购物车商品数据
                item.num = data.num;
            } else {  //  点击减号修改购物车商品数据
                item.num = --item.num;
            }
            item.index = index;
            item.parentIndex = parentIndex;
            shopCartArray.push(item)
            state.goodsList[parentIndex].list[index].num = item.num
            var arr = [];
            //去掉重复的
            for (var i = 0; i < shopCartArray.length; i++) {
                if (item.id == shopCartArray[i].id) {
                    shopCartArray.splice(i, 1, item)
                }
            }
            var arr1 = [];
            //当数量大于1的时候加
            for (var i = 0; i < shopCartArray.length; i++) {
                if (arr1.indexOf(shopCartArray[i]) == -1) {
                    arr1.push(shopCartArray[i]);
                    if (shopCartArray[i].num > 0) {
                        arr.push(arr1[i])
                    }
                }
            }
            $thisShopCart.shopCartArray = arr
        },
        //清空购物车
        emptyShopCartFun(state) {
            //根据选的采购方式，来操作不同购物车的数据  state.purchaseType =》 0：总店直供  1：门店自采
            var $thisShopCart = state.purchaseType == 0 ? state.shopCartObj.headquarters : state.shopCartObj.selfMining;
            $thisShopCart.shopCartArray = []
            $thisShopCart.allShopCartCount = 0
            $thisShopCart.allShopCartPrice = 0
            state.goodsList = state.copyGoodsList
        },
        //商品总价格
        allShopCartPrice(state) {
            var $thisShopCart = state.purchaseType == 0 ? state.shopCartObj.headquarters : state.shopCartObj.selfMining;
            var shopCart = $thisShopCart.shopCartArray;
            var allPrice = 0, allCount = 0;
            for (var i = 0; i < shopCart.length; i++) {
                var item = shopCart[i]
                allPrice += parseInt(item.num) * item.price;
                allCount += parseInt(item.num);
            }
            $thisShopCart.allShopCartPrice = allPrice;
            $thisShopCart.allShopCartCount = allCount;
        }
    },
    // action可以提交mutation，在action中可以执行store.commit，
    // 调用action，则需要执行store.dispatch
    actions: {},

})
